using System;
using System.Collections.Generic;
using System.Linq;
using Machine.Specifications;

namespace Avinor.NET.Specs.AvinorReader
{
    [Subject(typeof(AvinorWebClient))]
    public class when_reading_flights_from_avinor
    {
        static IEnumerable<Flight> flights;
        
        Because of = () =>
        {
            AvinorWebClient webClient = new AvinorWebClient();
             flights = webClient.GetFlights(new FlightsQuery("SVG"));
        };

        It should_get_flights = () =>
        {
            flights.Count().ShouldBeGreaterThan(0);
        };
    }

    [Subject(typeof(AvinorWebClient))]
    public class when_reading_airports_from_avinor
    {
        static IEnumerable<Airport> airports;

        Establish context = () =>
        {
        };

        Because of = () =>
        {
            AvinorWebClient webClient = new AvinorWebClient();
            airports = webClient.GetAirports();
        };

        It should_get_airports = () =>
        {
            airports.Count().ShouldBeGreaterThan(0);
        };
    }
}